package com.tenbent.product.center.insures.dto;

import com.tenbent.product.base.dto.BaseDto;
import com.tenbent.product.center.insures.bo.SkuInfo;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;

/**
 * SKU信息
 *
 * @author Randy
 * 
 *         Created by ThinkPad on 2017/8/21.
 */
public class SkuInfoDto extends BaseDto {

	/** 产品ID **/
	@NotNull(message = "{product.id.not.empty}")
	private Integer productId;

	/** 类型代码 **/
	@NotEmpty(message = "{sku.info.type.code.not.empty}")
	private String typeCode;

	/** 类型文本 **/
	@NotEmpty(message = "{sku.info.type.text.not.empty}")
	private String typeText;

	/** 值代码 **/
	@NotEmpty(message = "{sku.info.value.code.not.empty}")
	private String valueCode;

	/** 值文本 **/
	@NotEmpty(message = "{sku.info.value.text.not.empty}")
	private String valueText;

	public SkuInfoDto() {

	}

	public SkuInfoDto(SkuInfo skuInfo) {
		super(skuInfo);
		setProductId(skuInfo.getProductId());
		setTypeCode(skuInfo.getTypeCode());
		setTypeText(skuInfo.getTypeText());
		setValueCode(skuInfo.getValueCode());
		setValueText(skuInfo.getValueText());
	}

	public SkuInfo transToBo() {
		SkuInfo skuInfo = new SkuInfo();
		super.transToBo(skuInfo);
		skuInfo.setProductId(this.getProductId());
		skuInfo.setTypeCode(this.getTypeCode());
		skuInfo.setTypeText(this.getTypeText());
		skuInfo.setValueCode(this.getValueCode());
		skuInfo.setValueText(this.getValueText());
		return skuInfo;
	}

	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}

	public String getTypeText() {
		return typeText;
	}

	public void setTypeText(String typeText) {
		this.typeText = typeText;
	}

	public String getValueCode() {
		return valueCode;
	}

	public void setValueCode(String valueCode) {
		this.valueCode = valueCode;
	}

	public String getValueText() {
		return valueText;
	}

	public void setValueText(String valueText) {
		this.valueText = valueText;
	}
}
